﻿using PureMVC.Interfaces;
using PureMVC.Patterns;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

///<summary>
///
///</summary>
public class StartMediator : Mediator
{
    public new static string NAME = "StartMediator";
    StartView view;
    public StartView StartView
    {
        get
        {
            if (view == null)
            {
                view = GameObject.Find("Canvas/View").GetComponent<StartView>();
            }
            return view;
        }
    }
    public StartMediator() : base(NAME)
    {
        StartView.Init();
        StartView.Close += () =>{ StartView.ClosePanel(); };
        StartView.Open += () => {StartView.OpenPanel();};
        StartView.PlayGame += () => { StateManager.GetInstance.IsSkipGameScnen = true; StartView.ChangeSprite();};
		StartView.soundAction += () => { StartView.OpenOrCloseSound(); };
		StartView.musicAction += () => { StartView.OpenOrCloseMusic(); };

    }   
}
